In [1]:
import os, sys
sys.path.insert(0, '/home/trax/trax/website')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "trax.settings")
import django
django.setup()
from tracks.models import Track, Laptime
from players.models import Player
In [9]:
a, b = Player.objects.filter(username__icontains='killsw')
print(a,b)
a.last_login, b.last_login
Out[9]:
In [15]:
print("Tracks:")
for t in Track.objects.filter(creator=b):
print(t)
print("Laptimes:")
for l in Laptime.objects.filter(player=b):
print(l.track)
In [17]:
l.player = a
l.save()
In [21]:
print(b.track_set.all())
print(b.laptime_set.all())
print(b.logentry_set.all())
print(b.pitaparticipation_set.all())
print(b.pitassistant_set.all())
print(b.pitlogentry_set.all())
print(b.playervehicle_set.all())
print(b.ssrparticipation_set.all())
print(b.staggeredstartrace_set.all())
In [23]:
# b.delete()
In [ ]: